package cn.crce.cloud9.simple;

/**
 * @author OnCloud9
 * @description
 * @project NRCE-TEST
 * @date 2022年09月10日 上午 10:37
 */
public class Case37 {
    public static void main(String args[]){
        //*********Found**********
        Point3 p = new Point3(5,5);
        System.out.println("点的当前坐标：("+p.x + "," + p.y+")");
        p.translate(3,4);
        //*********Found**********
        System.out.println("平移到："+ p.toString());
    }
}

class Point3 {
    public int x,y;
    public Point3() {
    }
    public Point3(int x,int y){
        this.x = x;
        this.y = y;
    }
    //*********Found**********
    public Point3(Point3 p){
        x = p.x;
        y = p.y;
    }
    public int getX(){
        return x;
    }
    public int getY(){
        return y;
    }
    public void moveTo(int x,int y){
        this.x = x;
        this.y = y;
    }
    public void moveTo(Point3 p){
        x = p.x;
        y = p.y;
    }
    public String toString(){
        return "("+ x + ","+ y + ")";
    }
    public void translate(int dx,int dy){ //平移
        this.x += dx;
        //*********Found**********
        this.y += dy;;
    }
}

